<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Registration form</title>
</head>
<body>

<%
    List<String> incorrectParameters;
    incorrectParameters = (List<String>) request.getAttribute("passAreEqual");
    if ((incorrectParameters!=null) && (incorrectParameters.size()>0) ){
%>
    <h3 align="center">Your
        <%
            for(String s : incorrectParameters){
        %>
        <%=s + " "%>
        <%
            }
        %>
        - incorrect! Please make sure you have fill all fields and didn't make mistake your password</h3>
<%
    } else {
%>
<h3>Please input some information about you</h3>
<%
    }
%>
<form action="client.add" method="POST">
    <table>
        <tr>
            <td>*First name:</td>
            <td><input type="text"
                       <%
                           if (request.getParameter("firstname") != null)
                           {
                       %>
                       value="<%=request.getParameter("firstname")%>"
                       <%
                           }
                       %>
                       name="firstname"/></td>
        </tr>
        <tr>
            <td>*Last name:</td>
            <td><input type="text"
                       <%
                           if (request.getParameter("lastname") != null)
                           {
                       %>
                       value="<%=request.getParameter("lastname")%>"
                       <%
                           }
                       %>
                       name="lastname"/></td>
        </tr>
        <tr>
            <td>Phone number:</td>
            <td><input type="text"
                       <%
                           if (request.getParameter("phonenumber") != null)
                           {
                       %>
                       value="<%=request.getParameter("phonenumber")%>"
                       <%
                           }
                       %>
                       name="phonenumber"/></td>
        </tr>
        <tr>
            <td>*Email:</td>
            <td><input type="text"
                       <%
                           if (request.getParameter("email") != null)
                           {
                       %>
                       value="<%=request.getParameter("email")%>"
                       <%
                           }
                       %>
                       name="email"/></td>
        </tr>
        <tr>
            <td>*Password:</td>
            <td><input type="password" name="pass1"/></td>
        </tr>
        <tr>
            <td>*Confirm Password:</td>
            <td><input type="password" name="pass2"/></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" value="confirm" style="width:100%"/></td>
        </tr>

    </table>

</form>
</body>

</html>